<?php
/**
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 */
 
class ACatnavHelper
{
	function fromForum($forum_id) {
		$forum_id = (int)$forum_id;
		foreach ($this->controller->forumList as $cat) {
			if (isset($cat['forums'][$forum_id])) {
				$current_category = $cat['cat_name'];
				$current_category_id = $cat['cat_id'];
				$this->view->assign('current_category',$current_category);
				$this->view->assign('current_category_id',$current_category_id);
				break;
			}
		}
	}

	function fromCategory($category_id) {
		$category_id = (int)$category_id;
		$current_category = $this->controller->forumList[$category_id]['cat_name'];
		$current_category_id = $category_id;
		$this->view->assign('current_category',$current_category);
		$this->view->assign('current_category_id',$current_category_id);
	}

	
	function assign(& $view) {
		$this->view = $view;
	}
}
?>
